feat(api) add consistent error codes for API responses#745
Open
Krishnavamsi-codes wants to merge 3 commits into
Open
feat(api) add consistent error codes for API responses#745Krishnavamsi-codes wants to merge 3 commits into
Krishnavamsi-codes wants to merge 3 commits into
Conversation
b4c72c4 to
e91e7a0
Compare
Owner
|
@Krishnavamsi-codes CI failing |
Author
|
Hi @imDarshanGK,sorry for the delay I've fixed the Ruff lint issues reported by CI and updated the branch with the latest upstream changes. The new commit is pushed and ready for review. Could you please approve/re-run the workflows when you get a chance? Thanks! |
Author
|
Bro @imDarshanGK whats wrong?? can u merge the PR |
Owner
|
@Krishnavamsi-codes CI failing |
9c76ac3 to
11ec55c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements consistent error codes for API responses across the backend.
Changes made
Added centralized exception handling via
backend/app/exceptions.pyIntroduced an
ErrorCodeenum with standardized string-based error codesAdded an
ErrorResponseschema for consistent API error responsesRegistered global handlers for:
HTTPExceptionRequestValidationErrorUpdated middleware responses to include error codes
Standardized API error responses to the format:
{ "error": "error_code", "detail": "Human-readable message" }Related Issue
Fixes #509
Type of change
Checklist
mainpytest -vand all tests passfeat/fix/docs/test: short descriptionScreenshots (if frontend change)
N/A
Test evidence